UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MkS3xCjwfDeVNhDDKhI3kB2tm9+l4k+7QXzdA1yPSsc=' 
WHERE 
  key_id = '4cad49d1c19d779cd39e34c87b7c81a7e8cb745040f9c2a7c66cb4b49eefa2b0' 
  AND (
    token = 'MkS3xCjwfDeVNhDDKhI3kB2tm9+l4k+7QXzdA1yPSsc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033