UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8HTiuhg5h7YKlwMYOsaLkccNFPHIOjWAsqJfY9zOnlY=' 
WHERE 
  key_id = 'fb6b23e608a6438ff6a6713b9233fb7a9a15df1338fce003d1b48396cbcc981c' 
  AND (
    token = '8HTiuhg5h7YKlwMYOsaLkccNFPHIOjWAsqJfY9zOnlY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027