UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R07oXfhDyznxaOs11dkIghFjsPF3NlifTiEcsJ8H5Ug='
WHERE
key_id = 'd6a8d7c3242317e16f0fd320044a17a95af4450cb8ac3b640adbe2724aacf419'
AND (
token = 'R07oXfhDyznxaOs11dkIghFjsPF3NlifTiEcsJ8H5Ug='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)