UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NTN9Uq58QmZET5eymyvc8BKv0U4UCHlSD8AT6zli7AQ=' 
WHERE 
  key_id = '64cd1859a7dd9f6b265bbecf3c5949c7c7c1301e48e9a4ed82905723706fade5' 
  AND (
    token = 'NTN9Uq58QmZET5eymyvc8BKv0U4UCHlSD8AT6zli7AQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023