UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RQhVaGQHflLP5C2h5lm1eXvcHj8xK5lTfcWKpON/9nw='
WHERE
key_id = '05d242bd035ead6e252a872f18ed84636e9053be073ddab033525014b8fc4cad'
AND (
token = 'RQhVaGQHflLP5C2h5lm1eXvcHj8xK5lTfcWKpON/9nw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)