UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XGV4R2tMNGIPnadgzxNrw0++MYd+AHalBgLxO0wQkp0='
WHERE
key_id = 'bd25524541d4817d38563f7fbc7c46302534ed607b931d0f0eabe2652ddde225'
AND (
token = 'XGV4R2tMNGIPnadgzxNrw0++MYd+AHalBgLxO0wQkp0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)