UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+SIMyZAEHWER2hihjo8RlqEYFbfi8+a6s2mo2nKSb1E='
WHERE
key_id = '5d8d16bc92168593745dfafbb8776ac814872e0f6294d211eb344c7574e4b635'
AND (
token = '+SIMyZAEHWER2hihjo8RlqEYFbfi8+a6s2mo2nKSb1E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)