UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3UEA1yh5F+qkrdaWgA+Gm0kT+Dua38pcbPL1jFn6jko=' 
WHERE 
  key_id = 'c1399b494a2ed6d4689e039bec941ea0bfc2c8f54f322381d9d22547fe73513c' 
  AND (
    token = '3UEA1yh5F+qkrdaWgA+Gm0kT+Dua38pcbPL1jFn6jko=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026