UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9IzShEkcoQeuWYYqr/3OOpMXLatyOomm1cMDVkIpxCo=' 
WHERE 
  key_id = '42f513101a97f405de1d3652e03f35c56a5584ec0bacd80423fb3db58fc4905c' 
  AND (
    token = '9IzShEkcoQeuWYYqr/3OOpMXLatyOomm1cMDVkIpxCo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027