UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sWy1mXnD3JFl2VhRGIbR/29Lfccaz4Uxvs3l4Taf3io='
WHERE
key_id = 'f9c962e1dcae57c432b6a705199026ec759837e7f40599de09ce2bed388c8eda'
AND (
token = 'sWy1mXnD3JFl2VhRGIbR/29Lfccaz4Uxvs3l4Taf3io='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)