UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's3xPAJURhiqk0snynMnNkO4K5BowC+a8czaZt8+tD/E='
WHERE
key_id = '9f6692a2d651e381da0c2876fb1017b530fd73ed9b3b881d017c2b49d84c8833'
AND (
token = 's3xPAJURhiqk0snynMnNkO4K5BowC+a8czaZt8+tD/E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)