UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '32+GW98MnHUxWkXL89HQ0giTz4zToJyqM2fYsGTrCJ4='
WHERE
key_id = 'e8c26ce1c3b2810ed24cdb9e817a288343ebceefd230bd6423b09a146bf9e3a7'
AND (
token = '32+GW98MnHUxWkXL89HQ0giTz4zToJyqM2fYsGTrCJ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)