UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yRz3KzDiHTCMeP1RslCxD39vvvnlg5i8aQZAHJsNZa8=' 
WHERE 
  key_id = '2d262f2bfd523577b7512741918f60767ddd1fbd5a2233851c3a1a3b3a4e3128' 
  AND (
    token = 'yRz3KzDiHTCMeP1RslCxD39vvvnlg5i8aQZAHJsNZa8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029