UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VnnwRPuEExmo35ViB6EfENqvr4Gf4dZYyP/btTFP4JE=' 
WHERE 
  key_id = '27719f01027185b5dfaa68762f759b85b7115624ac3f463250b2714b54389b2c' 
  AND (
    token = 'VnnwRPuEExmo35ViB6EfENqvr4Gf4dZYyP/btTFP4JE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045