UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tODTOi8HII61dmB7KE+OMQDcnA8JecabBjQ+rrOaGgE='
WHERE
key_id = '0b81f0bb600706cfe50170e3957c2a6d6f3d2df1299a1a4b2de4897270aee0d0'
AND (
token = 'tODTOi8HII61dmB7KE+OMQDcnA8JecabBjQ+rrOaGgE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)