UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g0ZyYeSSIPBlRSva75RKjJhYMl49ezlTGOkeiy3SHDg=' 
WHERE 
  key_id = '4845540501291280ebe3d476d9411fca4d2559664d6cbe108858af6ced0f19b3' 
  AND (
    token = 'g0ZyYeSSIPBlRSva75RKjJhYMl49ezlTGOkeiy3SHDg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031