UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ExWYB2/QSQfnuq5kGP4Fmv4ocftqNzia9dnDgIXl8WU=' 
WHERE 
  key_id = 'e3dc17fffa13a65e18e9ca9b797a1a9429a6a51a5b93134fd4d7424eff230fc7' 
  AND (
    token = 'ExWYB2/QSQfnuq5kGP4Fmv4ocftqNzia9dnDgIXl8WU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022