UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NxINND5a9nfh1fVBT0c06Zt2XxnV3RZ1eTEfNpruvk4=' 
WHERE 
  key_id = '2b6a4432503e24fbc9a3087e681ac580bacdf704833b95de02aceee20fa33b95' 
  AND (
    token = 'NxINND5a9nfh1fVBT0c06Zt2XxnV3RZ1eTEfNpruvk4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023