UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gcuQuFfwyxA8VuIbnoEZ2n6vJKferuAh/vrdsGruDCw='
WHERE
key_id = '0bbc168cf826ff3dd2425bc4e30d1dc227f2d41122a0eb2556252dd972da6b8e'
AND (
token = 'gcuQuFfwyxA8VuIbnoEZ2n6vJKferuAh/vrdsGruDCw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)