UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VT98cqT5ye5P6iJULxRPOoQuNyIkCtFVz9nvYyiqyz0='
WHERE
key_id = '4c128124c97d42ee7918ad2fc47301c952beb8a730050423d3786b5b70958213'
AND (
token = 'VT98cqT5ye5P6iJULxRPOoQuNyIkCtFVz9nvYyiqyz0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)