UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fd6hWYapeJohunQZ2y5nXxcXDsnlft97lPIEuN7TNxo='
WHERE
key_id = '15c57d3d038f9e6af914374fe10800c85ae9b370ea0a8575ca0e2f60f12a5b3a'
AND (
token = 'Fd6hWYapeJohunQZ2y5nXxcXDsnlft97lPIEuN7TNxo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)