UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ilDjTaqDGfgC/17AwdwKPR7sT/DaBunv1MVrF3KiQ7s=' 
WHERE 
  key_id = '9d3daaeb22c61fc5b94f8a532cf373505ca692816f318c41bdaa8b17b4e59559' 
  AND (
    token = 'ilDjTaqDGfgC/17AwdwKPR7sT/DaBunv1MVrF3KiQ7s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033