UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8XbB5/v9PhG1A7tv2OSYF2TL+KAxWbmZ7ThXd19U0kA='
WHERE
key_id = '87cbe2546ccb188f893aa3bc7036dba42716259e3698b48e8e9cd612b6972994'
AND (
token = '8XbB5/v9PhG1A7tv2OSYF2TL+KAxWbmZ7ThXd19U0kA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)