UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p9n5LU20DXzCfSkZ94sT+CbGlgpwgGYFqZ05nmS0nOs=' 
WHERE 
  key_id = 'afc6e454e2fddedd8e1103d5e4e81c2a8f89e07f351ff3965e8a1b0001f71433' 
  AND (
    token = 'p9n5LU20DXzCfSkZ94sT+CbGlgpwgGYFqZ05nmS0nOs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017