UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/fl5LGr8FAddXeUe5y9rTfDOdH1jGJ1krv52CydyaKk='
WHERE
key_id = '58ae6df359e5e22cbe4345933b1e7a2f3989b78472e349b4c1ddb62952d09b08'
AND (
token = '/fl5LGr8FAddXeUe5y9rTfDOdH1jGJ1krv52CydyaKk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)