UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dGkLXiB+py7eJDgMTWZcauy7jYehmLiIr15W9/t/hL8=' 
WHERE 
  key_id = '1cb6b5a5a3997f5dcba2e9a94e3d9a1969755952303bdd85a463e645b5903d59' 
  AND (
    token = 'dGkLXiB+py7eJDgMTWZcauy7jYehmLiIr15W9/t/hL8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033