UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wcSUxPW4jTROlY3Qve1xhmeGdx8qYlryEZViAFgmjFE=' 
WHERE 
  key_id = 'd782f06b6d7217e4eb8303f0ff7b827ffdd3d93fb49dd528115c84c9bc91dac3' 
  AND (
    token = 'wcSUxPW4jTROlY3Qve1xhmeGdx8qYlryEZViAFgmjFE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049