UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'muw3O+B4o5bVVLsvc1ttN1KLPLov6gFw69D6veMC1Wk='
WHERE
key_id = 'f77ebfefbebf40413646e66feec063ab1bcc26b53bb92e6e0660111bcf2b2efa'
AND (
token = 'muw3O+B4o5bVVLsvc1ttN1KLPLov6gFw69D6veMC1Wk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)