UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dsDlO8FVNf4C7/huz5M3w+tktTms8G3GNvGxGnCXUkQ=' 
WHERE 
  key_id = '37d359cdecb8ec66530bf7c07d46e0476187878f0ab16a1ed368458c694242b5' 
  AND (
    token = 'dsDlO8FVNf4C7/huz5M3w+tktTms8G3GNvGxGnCXUkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029