UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FR4cROaee45KNGd78R3UP5KzHugA+728Xfqw/VcnrDs=' 
WHERE 
  key_id = 'ef2f484a48237336e7c0c0f00d9b957e3420ea6033e197ead2c52fc953e99c22' 
  AND (
    token = 'FR4cROaee45KNGd78R3UP5KzHugA+728Xfqw/VcnrDs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035