UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+4RA/Rt8FPWeWlIcl1H8V4n5/5jMuQC3/rRSeKFUMbw='
WHERE
key_id = '8e7c32296243a3add346d2da9b13372f215de0bd1ec864f1a3f7b17e629cd80b'
AND (
token = '+4RA/Rt8FPWeWlIcl1H8V4n5/5jMuQC3/rRSeKFUMbw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)