UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lv7B6YOR1oWoBdsfQRxjsrHc1X6pfLUXt1DfcjnXoV4='
WHERE
key_id = '629324e7848a5fe8e72be4fc7be489fde250178fbf3eb2f43fe102159d90f33c'
AND (
token = 'lv7B6YOR1oWoBdsfQRxjsrHc1X6pfLUXt1DfcjnXoV4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)