UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '896OPvxuDbtkFoWiFSWA0/QGfwBStqLxHzkpuhqyx88=' 
WHERE 
  key_id = 'b03caf5a03f29056a6de880c6429fe6d5d387f1ce46857786cb02374b024a2e7' 
  AND (
    token = '896OPvxuDbtkFoWiFSWA0/QGfwBStqLxHzkpuhqyx88=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047