UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pFLYct3kC8HgTtCNHpcfPk65lgWppypO5h/p0iKvPEY=' 
WHERE 
  key_id = '8a952d8f70391c2c5496753a3a88d0e03c1a064178205e33c1964c53b40c9727' 
  AND (
    token = 'pFLYct3kC8HgTtCNHpcfPk65lgWppypO5h/p0iKvPEY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026