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