UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+XgveqqaSZ2WspOvlES5Bti1bIEcoMRYrcLoEyyvm0s='
WHERE
key_id = '8ff7ca7fe4bdf1e033c0ed821593284f98dcabb05d23e8c9795f53c9b6016f58'
AND (
token = '+XgveqqaSZ2WspOvlES5Bti1bIEcoMRYrcLoEyyvm0s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)