UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kEe6QlUC2V/8YzFdCAOG970K0dPKWmyxuhhifNjrJP0=' 
WHERE 
  key_id = '1ca3ea39e6adb62563f43665a7971a5ef3e3cde90109ff06a1e61c9d1ec36375' 
  AND (
    token = 'kEe6QlUC2V/8YzFdCAOG970K0dPKWmyxuhhifNjrJP0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023