UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZDE1CB/PdtAM1Alk5LdMtNLktyXfATtjpk6f/eAaHBY=' 
WHERE 
  key_id = 'e9d4ea431dd92c8999a5d852660da1febe9db9e362ecf71d8a737c5b0f5ab5a3' 
  AND (
    token = 'ZDE1CB/PdtAM1Alk5LdMtNLktyXfATtjpk6f/eAaHBY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033