UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xNbHo8m33X05OLsr8PCSr5fsy7URAJhBMfa8rE/n6rg=' 
WHERE 
  key_id = '8b7b942719ccd93cf29e2e6f9e175652095e48ddce87c59c9d86eb2e0700d52e' 
  AND (
    token = 'xNbHo8m33X05OLsr8PCSr5fsy7URAJhBMfa8rE/n6rg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030