UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WOdS9ShRDqL+YlNbMvEM4uyra9qw0tz+lDDMKCqoAgY='
WHERE
key_id = 'e45ac2a4780a4f9c7bd20d399e1676e5e53e13162bf882dd40186c250b93b5cf'
AND (
token = 'WOdS9ShRDqL+YlNbMvEM4uyra9qw0tz+lDDMKCqoAgY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)