UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9SHLKWwmQZZIw5ukDKNd/XmBIQ6jGVj6MJXKhlmGArk='
WHERE
key_id = '4ad17f00277987dfcaa138f643fd866962f00700e66deebd1ccb2ef43d9263b6'
AND (
token = '9SHLKWwmQZZIw5ukDKNd/XmBIQ6jGVj6MJXKhlmGArk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)