UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jf9Lkz2N11tGWKOdDzRTkoyDlCAsxlwmpbneh1iJU+4='
WHERE
key_id = '635e6c35a09a590e9f0239166afcdf912e70b032dcfe3cd87a8071df2ef747ae'
AND (
token = 'jf9Lkz2N11tGWKOdDzRTkoyDlCAsxlwmpbneh1iJU+4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)