UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'adORn07rM9jGBlPpcYDaaFaaB+EEbRNx6DnPkfFxP7w='
WHERE
key_id = 'c6c7ac83dfbce1bf2cbdc1f254fc07b5f9cb127645cff76203fc598047b00203'
AND (
token = 'adORn07rM9jGBlPpcYDaaFaaB+EEbRNx6DnPkfFxP7w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)