UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k5odAZ1ByA9s2uEdOnH9W7c8ZHvzcr1tWZ0JeA3Om9o=' 
WHERE 
  key_id = 'd75af700e4889e6b9fdd82825923332b87d9f7715cbd3ffc6d32d2d09cdad05b' 
  AND (
    token = 'k5odAZ1ByA9s2uEdOnH9W7c8ZHvzcr1tWZ0JeA3Om9o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029