UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ha75cB8EUpWYjrZ8mofZU5sFHGP7kz9Tg3ZHWCrT4xY=' 
WHERE 
  key_id = '6bf919c24c0ac31459d8da5e98ae701ff2e30d8a6eb3d308eb4f1ddbdc5ec156' 
  AND (
    token = 'Ha75cB8EUpWYjrZ8mofZU5sFHGP7kz9Tg3ZHWCrT4xY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041