UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D2UfDv8kfzvhsQZoL9mKkMTjcaj7cArBM/zS4BFvW30='
WHERE
key_id = '8dfe1849a936510a994d4543a81bb3cce5508fb5db93f6929b5a8ddf532a0ffb'
AND (
token = 'D2UfDv8kfzvhsQZoL9mKkMTjcaj7cArBM/zS4BFvW30='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)