UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+/k6F2lc9CmEzaLVwn0KlLutfWEK0MIPCt9ke5IQx3s='
WHERE
key_id = 'c7912ddb7cee25bae3592cb0163668266dc530b6d86c29b672fea8427428949b'
AND (
token = '+/k6F2lc9CmEzaLVwn0KlLutfWEK0MIPCt9ke5IQx3s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)