UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CxwWhZpeJp7uWOBCsai2Mf2+bPc8PpObZUpeAOz+1Qk='
WHERE
key_id = 'b932e7c8bdeabcb7ddebac8d21332dd18a18ddf9c6a9d11ffbd70f3c2e7432e8'
AND (
token = 'CxwWhZpeJp7uWOBCsai2Mf2+bPc8PpObZUpeAOz+1Qk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)