UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dfvYnBcmKwOSRujlST3iRmiDdhw+Fc2+GI/YnkcC/4A='
WHERE
key_id = 'a94a0906b37d74a175baffe284d1434a9de74b1dd8a135cbb9395df4a9b11a18'
AND (
token = 'dfvYnBcmKwOSRujlST3iRmiDdhw+Fc2+GI/YnkcC/4A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)