UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dGGTUOuUlyKQgk+CT3YOgMkqqahR18BqZl6jSZMosqo='
WHERE
key_id = 'b3139b572db2d5169a0ad08ae5e87cc725fd75270883c43e07acc5ba49d050b7'
AND (
token = 'dGGTUOuUlyKQgk+CT3YOgMkqqahR18BqZl6jSZMosqo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)