UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fJSVOuhzXNg3qKhgz4J13tCM3AsNJu+J97T9UZVjdbs='
WHERE
key_id = 'f6726878d9045bf7c872203cfff21081002384bb1f83a70c7f7a34cfe33c25e8'
AND (
token = 'fJSVOuhzXNg3qKhgz4J13tCM3AsNJu+J97T9UZVjdbs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)