UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FTcWMZy+d2HPnQHzLR8kZ8wCsZJHhuIV6pnOozM16PM=' 
WHERE 
  key_id = 'f62bbb1435b544eca97c89d3fc4546d30fdd9875b4b9e58ff432660a940dcbe5' 
  AND (
    token = 'FTcWMZy+d2HPnQHzLR8kZ8wCsZJHhuIV6pnOozM16PM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050