UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3QPU1dOsbHG5RhjH2UbBkQVrjWv7uAqesqiPBxx6jAo='
WHERE
key_id = 'f07dc3309ae0315ef3d9a3392d638f4e1bac1fb063f65782bfdb3166b0c04061'
AND (
token = '3QPU1dOsbHG5RhjH2UbBkQVrjWv7uAqesqiPBxx6jAo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)