UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MnC/9Lw7RzO4B6VxmeFpdffC1k0s0eSeNxu8ynNAEDw='
WHERE
key_id = 'a1d2aa8d2773bfa160dbf2d15b6183873a76e711edcabf75e2f309f0b83119d3'
AND (
token = 'MnC/9Lw7RzO4B6VxmeFpdffC1k0s0eSeNxu8ynNAEDw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)